import 'normalize.css'
import 'element-plus/theme-chalk/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import './styles/element-plus/index.scss'
import './styles/index.scss'

import App from './App.vue'
import type { UserModule } from './types/user-module'
import { router } from './router'
import { tryParseUrlToken } from '@/http/token'

const app = createApp(App)

// install all modules under `modules/`
Object.values(import.meta.glob<{ install: UserModule }>('./modules/*.ts', { eager: true })).forEach(
  (i) => i.install?.({ app, router }),
)

app.mount('#app')

tryParseUrlToken()
